

const baseURL = `https://quotes.morgan-ex.com`;
const URL = `http://103.214.146.209:80`;
import  request from '@/utils/request';

import {toast} from '@/utils/toast'
import { getToken } from '@/utils/server.js';

const Pagerequest = function(url, method, data) {
 return new Promise((resove,reject)=>{
	 	uni.request({
	 		header: {
	 			'content-type': 'application/x-www-form-urlencoded' ,//自定义请求头信息
				 // "Content-Type": "application/json; charset=UTF-8"
	 		},
	 		dataType:'json',
	 		url: url,
	 		method,
	 		data,
			success:function(data){
				if(data.statusCode>=500){
					// toast('服务异常,请稍后再试');
				}
				if(data.data.code!=200 && data.data.code!=undefined){
					toast(data.data.msg);
				}
				resove(data)
			},
	 		fail:function(err){
				console.log(err)
				reject('服务异常')
	 			// toast('服务异常,请稍后再试');
	 			uni.hideLoading();
	 		}
	 	})
	
 })
	 
}


